/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.easoftware.code.beans.maintenance.navigator.impl;

import java.io.Serializable;
import java.util.List;
import javax.enterprise.context.SessionScoped;
import javax.inject.Inject;
import javax.inject.Named;
import net.easoftware.code.beans.jpa.OrdencaStore;
import net.easoftware.code.beans.maintenance.DataTableController;
import net.easoftware.code.beans.maintenance.navigator.NavigatorConfig;
import net.easoftware.code.dao.CatalogosDao;

/**
 *
 * @author Eliu
 */
@Named("VentasNav")
@SessionScoped
public class VentasNav implements NavigatorConfig, Serializable {

    @Inject
    CatalogosDao catalogosDao;
    private DataTableController dc;

    @Override
    public DataTableController getCustomDataTableController() {
        if (dc == null) {
            dc = new DataTableController();
            List allCheques = catalogosDao.getAllFromEntity(OrdencaStore.class);
            dc.setDataSource(allCheques);
            dc.setObjectTemplate(OrdencaStore.class);
            dc.doBind();
        }
        return dc;
    }

    @Override
    public Object doSelect(String field, Object value) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Object doFilter(String field, Object value) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public String getTitle() {
        return "Navegador Ventas";
    }
}
